QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Creating and Editing Polyhedra

QuickDraw 3D provides routines that you can use to create and manipulate polyhedra. See "Polyhedra" for the definition of a polyhedron.

Q3Polyhedron_New

You can use the Q3Polyhedron_New function to create a new polyhedron.

TQ3GeometryObject Q3Polyhedron_New (
                     const TQ3PolyhedronData *polyhedronData);
polyhedronData
A pointer to a TQ3PolyhedronData structure.

DESCRIPTION

The Q3Polyhedron_New function returns, as its function result, a new polyhedron having the shape and attributes specified by the polyhedronData parameter. If a new polyhedron could not be created, Q3Polyhedron_New returns the value NULL .

Q3Polyhedron_Submit

You can use the Q3Polyhedron_Submit function to submit an immediate polyhedron for drawing, picking, bounding, or writing.

TQ3Status Q3Polyhedron_Submit (
                     const TQ3PolyhedronData *polyhedronData,
                     TQ3ViewObject view);
polyhedronData
A pointer to a TQ3PolyhedronData structure.
view
A view.

DESCRIPTION

The Q3Polyhedron_Submit function submits for drawing, picking, bounding, or writing the immediate polyhedron whose shape and attribute set are specified by the polyhedronData parameter. The polyhedron is drawn, picked, bounded, or written according to the view characteristics specified in the view parameter.

SPECIAL CONSIDERATIONS

You should call this function only in a submitting loop.

Q3Polyhedron_GetData

You can use the Q3Polyhedron_GetData function to get the data that defines a polyhedron and its attributes.

TQ3Status Q3Polyhedron_GetData (
                     TQ3GeometryObject polyhedron,
                     TQ3PolyhedronData *polyhedronData);
polyhedron
A polyhedron.
polyhedronData
On exit, a pointer to a TQ3PolyhedronData structure that contains information about the polyhedron specified by the polyhedron parameter.

DESCRIPTION

The Q3Polyhedron_GetData function returns, through the polyhedronData parameter, information about the polyhedron specified by the polyhedron parameter. QuickDraw 3D allocates memory for the TQ3PolyhedronData structure internally; you must call Q3Polyhedron_EmptyData to dispose of that memory.

Q3Polyhedron_SetData

You can use the Q3Polyhedron_SetData function to set the data that defines a polyhedron and its attributes.

TQ3Status Q3Polyhedron_SetData (
                     TQ3GeometryObject polyhedron,
                     const TQ3PolyhedronData *polyhedronData);
polyhedron
A polyhedron.
polyhedronData
A pointer to a TQ3PolyhedronData structure.

DESCRIPTION

The Q3Polyhedron_SetData function sets the data associated with the polyhedron specified by the polyhedron parameter to the data specified by the polyhedronData parameter.

Q3Polyhedron_EmptyData

You can use the Q3Polyhedron_EmptyData function to release the memory occupied by the data structure returned by a previous call to Q3Polyhedron_GetData .

TQ3Status Q3Polyhedron_EmptyData (TQ3PolyhedronData *polyhedronData);
polyhedronData
A pointer to a TQ3PolyhedronData structure.

DESCRIPTION

The Q3Polyhedron_EmptyData function releases the memory occupied by the TQ3PolyhedronData structure pointed to by the polyhedronData parameter; that memory was allocated by a previous call to Q3Polyhedron_GetData .

Q3Polyhedron_GetVertexPosition

You can use the Q3Polyhedron_GetVertexPosition function to get the position of a vertex of a polyhedron.

TQ3Status Q3Polyhedron_GetVertexPosition (
                     TQ3GeometryObject polyhedron,
                     unsigned long index,
                     TQ3Point3D *point);
polyhedron
A polyhedron.
index
An index into an array of three-dimensional points.
point
A pointer to the array of points in the polyhedron.

DESCRIPTION

The Q3Polyhedron_GetVertexPosition function returns, in the point parameter, the position of the vertex having the index specified by the index parameter in the vertices array of the polyhedron specified by the polyhedron parameter.

Q3Polyhedron_SetVertexPosition

You can use the Q3Polyhedron_SetVertexPosition function to set the position of a vertex of a polyhedron.

TQ3Status Q3Polyhedron_SetVertexPosition (
                     TQ3GeometryObject polyhedron,
                     unsigned long index,
                     const TQ3Point3D *point);
polyhedron
A polyhedron.
index
An index into an array of three-dimensional points.
point
A pointer to the array of points in the polyhedron.

DESCRIPTION

The Q3Polyhedron_SetVertexPosition function sets the position of the vertex having the index specified by the index parameter in the vertices array of the polyhedron specified by the polyhedron parameter to that specified in the point parameter.

Q3Polyhedron_GetVertexAttributeSet

You can use the Q3Polyhedron_GetVertexAttributeSet function to get the attribute set of a vertex of a polyhedron.

TQ3Status Q3Polyhedron_GetVertexAttributeSet (
                     TQ3GeometryObject polyhedron,
                     unsigned long index,
                     TQ3AttributeSet *attributeSet);
polyhedron
A polyhedron.
index
An index into an array of three-dimensional points.
attributeSet
On exit, a pointer to a vertex attribute set.

DESCRIPTION

The Q3Polyhedron_GetVertexAttributeSet function returns, in the attributeSet parameter, the set of attributes for the vertex having the index specified by the index parameter in the vertices array of the polyhedron specified by the polyhedron parameter. The reference count of the set is incremented.

Q3Polyhedron_SetVertexAttributeSet

You can use the Q3Polyhedron_SetVertexAttributeSet function to set the attribute set of a vertex of a polyhedron.

TQ3Status Q3Polyhedron_SetVertexAttributeSet (
                     TQ3GeometryObject polyhedron,
                     unsigned long index,
                     TQ3AttributeSet attributeSet);
polyhedron
A polyhedron.
index
An index into an array of three-dimensional points.
attributeSet
On exit, a pointer to a vertex attribute set.

DESCRIPTION

The Q3Polyhedron_SetVertexAttributeSet function sets the attribute set of the vertex having the index specified by the index parameter in the vertices array of the polyhedron specified by the polyhedron parameter to the set specified in the attributeSet parameter.

Q3Polyhedron_GetTriangleData

You can use the Q3Polyhedron_GetTriangleData function to get the data for a face in a polyhedron.

TQ3Status Q3Polyhedron_GetTriangleData (
                     TQ3GeometryObject polyhedron,
                     unsigned long triangleIndex,
                     TQ3PolyhedronTriangleData *triangleData);
polyhedron
A polyhedron.
triangleIndex
A triangle index. The value in this parameter should be greater than or equal to 0 and less than the total number of triangles (that is, faces) in the specified polyhedron.
triangleData
On entry, a pointer to a polyhedron triangle data structure. On exit, the data in that structure is set to the specified triangle in the specified polyhedron.

DESCRIPTION

The Q3Polyhedron_GetTriangleData function returns, in the triangleData parameter, the data for the triangle specified by the triangleIndex parameter in the polyhedron specified by the polyhedron parameter.

Q3Polyhedron_SetTriangleData

You can use the Q3Polyhedron_SetTriangleData function to set the data for a face in a polyhedron.

TQ3Status Q3Polyhedron_SetTriangleData (
                     TQ3GeometryObject polyhedron,
                     unsigned long triangleIndex,
                     const TQ3PolyhedronTriangleData *triangleData);
polyhedron
A polyhedron.
triangleIndex
A triangle index. The value in this parameter should be greater than or equal to 0 and less than the total number of triangles (that is, faces) in the specified polyhedron.
triangleData
A pointer to a polyhedron triangle data structure.

DESCRIPTION

The Q3Polyhedron_SetTriangleData function sets the data for the triangle specified by the triangleIndex parameter in the polyhedron specified by the polyhedron parameter to the data specified by the triangleData parameter.

Q3Polyhedron_GetEdgeData

You can use the Q3Polyhedron_GetEdgeData function to get the data that describe an edge in a polyhedron.

TQ3Status Q3Polyhedron_GetEdgeData (
                     TQ3GeometryObject polyhedron,
                     unsigned long edgeIndex,
                     TQ3PolyhedronEdgeData *edgeData);
polyhedron
A polyhedron.
edgeIndex
An edge index. The value in this parameter should be greater than or equal to 0 and less than the total number of edges in the specified polyhedron.
edgeData
On entry, a pointer to a polyhedron edge data structure. On exit, the data in that structure is set to the specified edge in the specified polyhedron.

DESCRIPTION

The Q3Polyhedron_GetEdgeData function returns, in the edgeData parameter, the data for the edge specified by the edgeIndex parameter in the polyhedron specified by the polyhedron parameter.

Q3Polyhedron_SetEdgeData

You can use the Q3Polyhedron_SetEdgeData function to set the data that describe an edge in a polyhedron.

TQ3Status Q3Polyhedron_SetEdgeData (
                     TQ3GeometryObject polyhedron,
                     unsigned long edgeIndex,
                     const TQ3PolyhedronEdgeData *edgeData);
polyhedron
A polyhedron.
edgeIndex
An edge index. The value in this parameter should be greater than or equal to 0 and less than the total number of edges in the specified polyhedron.
edgeData
A pointer to a polyhedron edge data structure.

DESCRIPTION

The Q3Polyhedron_SetEdgeData function sets the data for the edge specified by the edgeIndex parameter in the polyhedron specified by the polyhedron parameter to the data specified by the edgeData parameter.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |